/*************************************************************************
                           pmElement  -  description
                             -------------------
    début                : 28 déc. 2009
    copyright            : (C) 2009 par nical
 *************************************************************************/

#ifndef PMELEMENT_H_
#define PMELEMENT_H_
//------------------------------------------------------------- Includes
#include <string>
//------------------------------------------------------------- Constants
//------------------------------------------------------------------ Types

//------------------------------------------------------------------------
// The pmElement class is a generic description of any kind of object that
// can be processed through the boxes of a pipeline. any object that is to
// be used as input/output of a Box must then inherit from the pmElement
// mother-class and implement the GetType, GetName, and GetValue methods
//------------------------------------------------------------------------
template <class T = double> class pmElement
{
	//----------------------------------------------------------------- PUBLIC
public:
	//----------------------------------------------------- Méthodes publiques
	virtual T GetValue(int index1 = 0, int index2 = 0, int index3 = 0)=0;
	// most important method: returns a scalar value contained in the object
	// for the boxes to do their job.
	// the optional parameters may be used to retrieve the the correct value
	// if the pmElement is, for exemple some kind of array
	virtual bool SetValue(T value, int index1 = 0, int index2 = 0, int index3 = 0)=0;
	virtual unsigned GetDimension()=0;
	virtual unsigned GetSize(unsigned dimIndex = 1)=0;

	std::string GetName() {return m_name;};

	virtual ~pmElement ( ){};

protected:

	//----------------------------------------------------- protected methods
	// the following methods shouldn't be used so place them protected to make
	// sure it's never used even as default behaviour of the compilator
	//--------------------------------------------------- operator overloading
	//pmElement & operator = ( const pmElement & unpmElement );
	// Contract : do not use this operator
	//-------------------------------------------- Constructeurs - destructeur
	pmElement(){};
	//pmElement ( const pmElement & unpmElement );
	// Contract : do not use the copy constructor

	//--------------------------------------------------- protected attributes
	std::string m_name;
};

#endif // PMELEMENT_H_
